using UnityEngine;

public class NavigationByTwoPoints : NavigationByPoints
{
	public int moveTime;

	public Vector3 moveVector;

	private float halhPathTime;

	[SerializeField]
	private float timeWait = 5f;

	protected override void Start()
	{
		_moveTime = moveTime;
		halhPathTime = _moveTime / 2f;
		base.Start();
	}

	protected override Vector3 CalcPositiion(float value)
	{
		if (value <= timeWait)
		{
			return Vector3.zero;
		}
		if (value > timeWait && value <= halhPathTime)
		{
			return moveVector * ((value - timeWait) / (halhPathTime - timeWait));
		}
		if (value > halhPathTime && value <= halhPathTime + timeWait)
		{
			return moveVector;
		}
		return moveVector - moveVector * ((value - halhPathTime - timeWait) / (halhPathTime - timeWait));
	}
}
